package tomoto.util;

/**
 * Helper utilities to augment {@link java.lang.Math}.
 * 
 * @author Tomoto Shimizu Washio
 * 
 */
public class MathUtil {

	/**
	 * Returns a square of the given value.  An overflow is not checked.
	 * 
	 * @param i input value
	 * @return as described above
	 */
	public static int sqr(int i) {
		return i * i;
	}

    public static int fact(int i) {
        assert i >= 0;
        return (i == 0) ? 1 : (i * fact(i - 1));
    }

}
